package first.program;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Random;

import android.util.Log;

public class CreateGame {
	
	String thePassword[] = new String[4];
	String colors[] = {"green", "orange", "black", "blue","red", "purple","yellow","gray"};
	int pwLength = 4;
	
	
	
	public void createRep(){
		
      	Random seed = new Random();
    	for (int i = 0; i < 4; i++)
    	{
    		int randcolor = seed.nextInt(8);
    		thePassword[i] = colors[randcolor];
    		Log.i("CreateGame", "color is "+thePassword[i]);
    	}
		
	}
	
	public void createNonRep(){
		Log.i("CreateGame", "repeats not allowed");
		ArrayList<Integer> number = new ArrayList<Integer>();
		for (int i = 0; i < 8; ++i) number.add(i);
		Collections.shuffle(number);
		for(int i = 0; i < pwLength; i++){
			int shit = number.remove(i);
    		thePassword[i] = colors[shit];
    		Log.i("CreateGame", "hmm..color is "+thePassword[i]);
		}
	}
	
	public String getValue (int i){
		return thePassword[i];
	}
	
	public String[] getPassword (){
		return thePassword;
	}
	
	

}



